﻿using UnityEngine;
using System.Collections;

public class BetewnScenary{

    private UISprite LoadingSprite;
    private UISpriteAnimation LoadingAnimation;

    public BetewnScenary()
    {
        CreateControls();
        PositionControls();
    }

    private void CreateControls()
    {
        LoadingSprite = UI.firstToolkit.addSprite("Bag.png", 0, 0, 1);
        LoadingAnimation = LoadingSprite.addSpriteAnimation("LoadingAnimation", 0.15f, "Book.png", "Home.png", "Knock.png", "Paper.png", "Save.png");
        LoadingAnimation.loopReverse = true;
    }

    private void PositionControls()
    {
        LoadingSprite.positionCenter();
    }

    public void StartAnimation()
    {
        LoadingSprite.playSpriteAnimation(LoadingAnimation, 5);
    }

    public void StopAnimation()
    {
        LoadingAnimation.stop();
    }
	
}
